package main

import (
	"a_plus_station/global"
	"a_plus_station/initialize"
	"a_plus_station/tables"
	"fmt"
	"go.uber.org/zap"
)

func main() {
	initialize.InitConfig("./")
	if err := initialize.InitLogger(&global.ServerConfig.LogConfig); err != nil {
		fmt.Printf("init logger failed, err:%v\n", err)
		return
	}

	zap.S().Infof("启动服务器, 端口: %v", global.ServerConfig)

	initialize.InitDB()

	// 查询用户
	var user []tables.User
	total := new(int64)
	global.DB.Model(&tables.User{}).Find(&user).Count(total)
	for i, u := range user {
		fmt.Println(i, u)
	}

	// 查询商品

}
